define(["../common"], function() {
	var $form = $("#form_feedback");
	
	var formCfg = {
		fields: {
			content: "内容:required"
		}
	}
	
	requirePlugin(["validator"], function() {
		$form.validator(formCfg);
	});
	
	$form.on('valid.form', function(e, form){
		$form.loadMsg("正在提交...");
		$.post(g_domain + "/feedback/addDo/json",$form.serialize(), function(data){
				if (data.status != 0) {
					$form.failMsg(data.message);
					return;
				} 
				$form.infoMsg("提交成功，感谢您的参与！");
				setTimeout(function() {
					history.back();
				}, 2000);				
		});
	});
	
});